home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / misc / samples2 / sunken.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-24  |  1.7 KB  |  50 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   5820
  6.    ClientLeft      =   1095
  7.    ClientTop       =   1770
  8.    ClientWidth     =   7365
  9.    Height          =   6510
  10.    Left            =   1035
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   388
  13.    ScaleMode       =   3  'Pixel
  14.    ScaleWidth      =   491
  15.    Top             =   1140
  16.    Width           =   7485
  17.    Begin TextBox Text1 
  18.       Height          =   3480
  19.       Left            =   990
  20.       TabIndex        =   0
  21.       Text            =   "Text1"
  22.       Top             =   630
  23.       Width           =   4830
  24.    End
  25.    Begin Menu mnuExit 
  26.       Caption         =   "Exit"
  27.    End
  28. Sub Apply3D2 (myForm As Form, MyCtl As Control)
  29.     'The first one is for Sunken effects. Your form should be gray for the color
  30.     'values I have listed. You will need tho set the form's ScaleMode to pixel. Call
  31.     'it from the form's Paint sub like so:
  32.     'For Raised effects just reverse the color values. where the values are 92
  33.     'put 255 and vise versa.
  34.     myForm.CurrentX = MyCtl.Left - 1
  35.     myForm.CurrentY = MyCtl.Top + MyCtl.Height
  36.     myForm.Line -Step(0, -(MyCtl.Height + 1)), RGB(92, 92, 92)
  37.     myForm.Line -Step(MyCtl.Width + 1, 0), RGB(92, 92, 92)
  38.     myForm.Line -Step(0, MyCtl.Height + 1), RGB(255, 255, 255)
  39.     myForm.Line -Step(-(MyCtl.Width + 1), 0), RGB(255, 255, 255)
  40. End Sub
  41. Sub Form_Paint ()
  42.     Call Apply3D2(Me, Text1)        ' This would be for a Text Box.
  43. End Sub
  44. Sub Form_Unload (Cancel As Integer)
  45.     End
  46. End Sub
  47. Sub mnuExit_Click ()
  48.     Unload Me
  49. End Sub
  50.